'use strict'

class user {
    constructor() {
        this.param = '/'
    }
    //创建资源
    async get(c) {
        try {
            let sqltext1 = `select * from users`
            var r1 = await c.service.psql.query(sqltext1);
            if (r1.rowCount == 0) {
                return c.send('have no user');
            }
            c.send(r1.rows);
            return
        }
        catch (err) {
            c.status(500).send('error');
        }
    }
}

module.exports = user